package com.zl.cms.model;

/**
 * User: zl email:c3tc3tc3t@126.com Date: 14-2-3 Time: 下午6:37
 */
public class ChannelTree {
  private Integer id;
  private String name;
  private Integer pid;
  /*private Object leaf;*/

/*  public Object getLeaf() {
    return leaf;
  }

  public void setLeaf(Object leaf) {
    this.leaf = leaf;
  }*/

  public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public Integer getPid() {
    return pid;
  }

  public void setPid(Integer pid) {
    this.pid = pid;
  }

  public ChannelTree() {}

  public ChannelTree(Integer id, String name, Integer pid/*, Integer leaf*/) {
    this.id = id;
    this.name = name;
    this.pid = pid;
    /*this.leaf = leaf;*/
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    ChannelTree that = (ChannelTree) o;

    if (!id.equals(that.getId())) return false;
    if (!name.equals(that.getName())) return false;
    if (pid != null ? !pid.equals(that.getPid()) : that.getPid() != null) return false;

    return true;
  }

  @Override
  public int hashCode() {
    int result = id.hashCode();
    result = 31 * result + name.hashCode();
    result = 31 * result + (pid != null ? pid.hashCode() : 0);
    return result;
  }

	@Override
	public String toString() {
		return "ChannelTree{" +
				"id=" + id +
				", name='" + name + '\'' +
				", pid=" + pid +
				/*", leaf=" + leaf +*/
				'}';
	}
}
